$().ready(function () {
   // 首页的列表页
    $.ajax({
        type: "POST",
        url: "/index.php?m=index&c=IndexAjax&a=getLiveRoomList",
        dataType: 'JSON',
        data:{
        },
        success: function(data){
            //第一个推荐的大图根据当前的人气来的
            var html  = ' <div class="item2">' +
                '                        <a uigs="zhibo_web_index_lunbotu_big" target="_blank"' +
                '                           href="/index.php?m=index&c=Index&a=liveRoom&id= '+data.data[0].id+'"' +
                '                           class="img">' +
                '                            <img src="' + data.data[0].live_logo+ '"' +
                '                                il="1" width="100%"' +
                '                                 height="100%">' +
                '                        </a>' +
                '                        <a uigs="zhibo_web_index_lunbotu_big" target="_blank"' +
                '                          href="/index.php?m=index&c=Index&a=liveRoom&id= '+data.data[0].id+'"' +
                '                           class="msg">' +
                '                            <div class="grad-bg"></div>' +
                '' +
                '                            <p class="dt">' + data.data[0].title+'</p>' +
                '                            <span class="name">'+ data.data[0].type_name+'</span>' +
                '' +
                '                            <span class="forum">' + data.data[0].name+ '</span>' +
                '                        </a>' +
                '                    </div>';
            $('.recommand-box-big').append(html);
            html1 = '';
            for (i = 1 ;i < data.data.length ; i++) {
                var html1 =  html1 + ' <div class="item" >' +
                    '                            <a uigs="zhibo_web_index_lunbotu_0" target="_blank"' +
                    '                               href="/index.php?m=index&c=Index&a=liveRoom&id=' +data.data[i].id+ '" class="img">' +
                    '                                <img src="' + data.data[i].live_logo+ '"' +
                    '                                     il="1" width="100%"' +
                    '                                     height="100%">' +
                    '' +
                    '                            </a>' +
                    '                            <a uigs="zhibo_web_index_lunbotu_0" target="_blank"' +
                    'href="/index.php?m=index&c=Index&a=liveRoom&id=' +data.data[i].id+'" class="msg">' +
                    '                                <div class="grad-bg"></div>' +
                    '' +
                    '                                <p class="dt"> '+ data.data[i].title +' </p>' +
                    '                                <span class="name">' + data.data[i].type_name+ '</span>' +
                    '' +
                    '                                <span class="forum"> ' + data.data[i].name+ ' </span>' +
                    '                            </a>' +
                    '                        </div>'
            }
            $('.recommand-box-right').append(html1);
        },
        error: function(XMLHttpRequest, textStatus, errorThrown){
        }
    });
    $.ajax({
        type: "POST",
        url: "/index.php?m=index&c=IndexAjax&a=getLiveRoomList&all_flag=1&type_flag=1",
        dataType: 'JSON',
        data:{
        },
        success: function(data){
            var datas = data.data;
            var html = '';
            $.each(datas, function (index, list) {
                var html = '<div class="section-wrap">' +
                    '            <div class="section-box">'
                var html = html + ' <div class="part1" style="background: url('+ list.info.background+') ;background-repeat:no-repeat;' +
                    '    background-size:100% 100%;' +
                    '    -moz-background-size:100% 100%;">' +
                    '                    <h2>' +
                    '                        <s class="part-tip01"></s>'+ list.info.name+'' +
                    '                    </h2>' +
                    '                </div>'
                $.each(list.list, function (ind, li) {
                     html += ' <a uigs="zhibo_web_index_channel_indexlol_lives_0" target="_blank"' +
                         '                   href="/index.php?m=index&c=Index&a=liveRoom&id= ' + li.id + '" class="item">' +
                         '                    <div class="img">' +
                         '                        <div class="tr-mask">' +
                         '                            <em></em>' +
                         '                        </div>' +
                         '                        <span class="g-name"></span>' +
                         '                        <img src="' + li.live_logo + '"' +
                         '                              il="1" width="100%"' +
                         '                             height="100%">' +
                         '                    </div>' +
                         '                    <div class="msg">' +
                         '                        <p class="figure">' +
                         '                            <img src=" '+ li.user_info.logo+' "' +
                         '                                 on il="1" width="100%"' +
                         '                                 height="100%">' +
                         '                        </p>' +
                         '                        <div class="msg-box">' +
                         '                            <p class="tt">' + li.name + '</p>' +
                         '                            <span class="zb">'+li.user_info.name +'</span>' +
                         '                            <span class="num">'+ li.user_nr +'</span>' +
                         '                        </div>' +
                         '                    </div>' +
                         '                </a>';
                 })
                html += ' </div>' +
                    '        </div>';
                $('.section').append(html);
            })
            //$('.section').append(html);
        },
        error: function(XMLHttpRequest, textStatus, errorThrown){
        }
    });
})